Skip to contentSkip to conversation

extend python3 manifest to add a module

DISCUSSION Perceval 2 participants 5 messages Feb 14, 2024

lore
Share & tools
lore

Perceval

author
#0 lore raw

Hello,

I'm building an image on the dunfell branch.
I would like to add dataclasses module in python3. For that I know that I should add it to the python3-manifest.json.
I tried to add my new manifest file in SRC_URI using a bbappend. It didn't work as the manifest file is red by a anonymous python function on parsing:

filename = os.path.join(d.getVar('THISDIR'), 'python3', 'python3-manifest.json')

What should I do to add dataclasses to my python3 installation? What is the suggested method or best practice for that operation? I would like to avoid forking openembedded-core just for that.

Thank you

Perceval

#1 lore raw
Quoted 11 lines · Perceval via lists.yoctoproject.org

Hello,

I'm building an image on the dunfell branch.
I would like to add dataclasses module in python3. For that I know that I should add it to the python3-manifest.json.
I tried to add my new manifest file in SRC_URI using a bbappend. It didn't work as the manifest file is red by a anonymous python function on parsing:

filename = os.path.join(d.getVar('THISDIR'), 'python3', 'python3-manifest.json')

What should I do to add dataclasses to my python3 installation? What is the suggested method or best practice for that operation? I would like to avoid forking openembedded-core just for that.

The manifest simply defines how the packages are split up, the dataclasses module is always packaged.

For some reason, it appears to be part of python3-profile in my build:

$ oe-pkgdata-util find-path /usr/lib/python3.12/dataclasses.py
python3-profile: /usr/lib/python3.12/dataclasses.py

That’s not right though, we should put that in a better package.

Ross

author
#2 lore raw

It seems that the dataclasses is not packaged in a dedicated package on the dunfell branch according to sources here <https://git.openembedded.org/openembedded-core/tree/meta/recipes-devtools/python/python3/python3-manifest.json?h=dunfell>

So it ends up in python3-misc which have a lot of things:

$ oe-pkgdata-util find-path /usr/lib/python3.8/dataclasses.py
python3-misc: /usr/lib/python3.8/dataclasses.py

Should we package it in a dedicated package or another one? What would you suggest?

Perceval

Quoted 27 lines · Ross Burton
Quoted 9 lines · On 14 Feb 2024, at 09:54, Perceval via lists.yoctoproject.org…

Hello,

I'm building an image on the dunfell branch.
I would like to add dataclasses module in python3. For that I know
that I should add it to the python3-manifest.json.
I tried to add my new manifest file in SRC_URI using a bbappend. It
didn't work as the manifest file is red by a anonymous python function on parsing:

Quoted 6 lines

filename = os.path.join(d.getVar('THISDIR'), 'python3',
'python3-manifest.json')

What should I do to add dataclasses to my python3 installation?
What is the suggested method or best practice for that operation?
I would like to avoid forking openembedded-core just for that.

The manifest simply defines how the packages are split up, the dataclasses module is always packaged.

For some reason, it appears to be part of python3-profile in my build:

$ oe-pkgdata-util find-path /usr/lib/python3.12/dataclasses.py
python3-profile: /usr/lib/python3.12/dataclasses.py

That’s not right though, we should put that in a better package.

Ross

#3 lore raw
Quoted 7 lines · Perceval

It seems that the dataclasses is not packaged in a dedicated package on the dunfell branch according to sources here https://git.openembedded.org/openembedded-core/tree/meta/recipes-devtools/python/python3/python3-manifest.json?h=dunfell
So it ends up in python3-misc which have a lot of things:

$ oe-pkgdata-util find-path /usr/lib/python3.8/dataclasses.py
python3-misc: /usr/lib/python3.8/dataclasses.py

Should we package it in a dedicated package or another one? What would you suggest?

For master I just sent a patch moving it into -core, because it’s a fairly fundamental package.

For dunfell, moving it now is probably not a great idea, but at least you know now what package to RDEPEND on to get the class.

(or, you can RDEPEND on python3-modules and you get the entire standard library)

Ross

author
#4 lore raw

Thank you very much,
yes indeed :)

Perceval

Quoted 18 lines · Ross Burton
Quoted 9 lines · On 14 Feb 2024, at 14:03, Perceval <[email protected]…

It seems that the dataclasses is not packaged in a dedicated
package on the dunfell branch according to sources here <https://git.openembedded.org/openembedded-core/tree/meta/recipes-devtools/python/python3/python3-manifest.json?h=dunfell>
So it ends up in python3-misc which have a lot of things:

 $ oe-pkgdata-util find-path /usr/lib/python3.8/dataclasses.py
 python3-misc: /usr/lib/python3.8/dataclasses.py

Should we package it in a dedicated package or another one? What
would you suggest?

For master I just sent a patch moving it into -core, because it’s a fairly fundamental package.

For dunfell, moving it now is probably not a great idea, but at least you know now what package to RDEPEND on to get the class.

(or, you can RDEPEND on python3-modules and you get the entire standard library)

Ross